<html>
<head><meta charset="utf-8"><title>macOS debug search · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/macOS.20debug.20search.html">macOS debug search</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="232664934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/macOS%20debug%20search/near/232664934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/macOS.20debug.20search.html#232664934">(Mar 31 2021 at 21:04)</a>:</h4>
<p><span class="user-mention" data-user-id="116015">@Alex Crichton</span> Do you happen to know the mechanism that is used on macOS to find the <code>.o</code> files in the <code>deps/</code> directory for the purpose of backtraces and debugging? </p>
<p>And, is there some way to tell lldb to search for those <code>.o</code> files in a different location?</p>
<p>There's an issue with trying to build <code>rustc</code> with debug symbols on macos.  Backtraces and lldb aren't able to see any symbols past rustc's query system (which is a bit confusing to me).  It works if I use dSYM (which requires some symlinks).</p>



<a name="232666664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/macOS%20debug%20search/near/232666664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/macOS.20debug.20search.html#232666664">(Mar 31 2021 at 21:18)</a>:</h4>
<p>afaik the executable embeds "these are the paths to my object files"</p>



<a name="232666703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/macOS%20debug%20search/near/232666703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/macOS.20debug.20search.html#232666703">(Mar 31 2021 at 21:18)</a>:</h4>
<p>and we just follow those paths</p>



<a name="232666746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/macOS%20debug%20search/near/232666746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/macOS.20debug.20search.html#232666746">(Mar 31 2021 at 21:18)</a>:</h4>
<p>so I don't think there's a way to change the directory, unless maybe you move the binary itself around?</p>



<a name="232666766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/macOS%20debug%20search/near/232666766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/macOS.20debug.20search.html#232666766">(Mar 31 2021 at 21:18)</a>:</h4>
<p>it's all kinda futz-y and fragile though afaik</p>



<a name="232667313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/macOS%20debug%20search/near/232667313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/macOS.20debug.20search.html#232667313">(Mar 31 2021 at 21:22)</a>:</h4>
<p>Hm.  Maybe dylibs behave differently?</p>



<a name="232667394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/macOS%20debug%20search/near/232667394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/macOS.20debug.20search.html#232667394">(Mar 31 2021 at 21:23)</a>:</h4>
<p>Do you happen to know where you could point me to where that <code>.o</code> searching code would be.  I've been looking at gimli/macho.rs, but I don't see how it does anything except search for a dSYM</p>



<a name="232668213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/macOS%20debug%20search/near/232668213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/macOS.20debug.20search.html#232668213">(Mar 31 2021 at 21:30)</a>:</h4>
<p>oh I don't think I ever looked into dylibs too too much</p>



<a name="232668225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/macOS%20debug%20search/near/232668225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/macOS.20debug.20search.html#232668225">(Mar 31 2021 at 21:30)</a>:</h4>
<p>so the story may be a little different there</p>



<a name="232668305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/macOS%20debug%20search/near/232668305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/macOS.20debug.20search.html#232668305">(Mar 31 2021 at 21:30)</a>:</h4>
<p>the searching code is roughly here -- <a href="https://github.com/rust-lang/backtrace-rs/blob/c6e5bffdbe44cb9da250bda0a061ad5558673235/src/symbolize/gimli/macho.rs#L246-L277">https://github.com/rust-lang/backtrace-rs/blob/c6e5bffdbe44cb9da250bda0a061ad5558673235/src/symbolize/gimli/macho.rs#L246-L277</a> (and <code>object_mapping</code> below)</p>



<a name="232668927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/macOS%20debug%20search/near/232668927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/macOS.20debug.20search.html#232668927">(Mar 31 2021 at 21:35)</a>:</h4>
<p>thanks, I'll poke around and see what I can find.</p>



<a name="232683828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/macOS%20debug%20search/near/232683828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/macOS.20debug.20search.html#232683828">(Mar 31 2021 at 23:57)</a>:</h4>
<p><span class="user-mention" data-user-id="116015">@Alex Crichton</span> Posted <a href="https://github.com/rust-lang/rust/issues/83730">https://github.com/rust-lang/rust/issues/83730</a> with what I found.  I'm a bit confused about why the dylib behavior is different from an executable.</p>



<a name="232688477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/macOS%20debug%20search/near/232688477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/macOS.20debug.20search.html#232688477">(Apr 01 2021 at 00:54)</a>:</h4>
<p>That does look fishy, I'll try to take a look soon</p>



<a name="232788583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/macOS%20debug%20search/near/232788583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/macOS.20debug.20search.html#232788583">(Apr 01 2021 at 16:48)</a>:</h4>
<p>Ok found the issue, it's due to our use of temporary files</p>



<a name="232788633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/macOS%20debug%20search/near/232788633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/macOS.20debug.20search.html#232788633">(Apr 01 2021 at 16:48)</a>:</h4>
<p>I should really add a debug println somewhere in the gimli code to say "we tried to find this file on the filesystem and it wasn't there", with split debuginfo that happens a lot...</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>